
package com.qf.service.impl;



import java.util.List;

import com.qf.dao.impl.UserDaoImpl;
import com.qf.model.Contact;
import com.qf.model.TelBook;
import com.qf.model.User;
import com.qf.service.UserService;

public class UserServiceImpl implements UserService{
	private UserDaoImpl userDaoImpl=new UserDaoImpl();
	@Override
	public User checkUser(String uname, String upwd) {
		String sql="select * from user where uname=? and upwd=?;";
		//TODO
		return userDaoImpl.findByCondition(sql,new Object[]{uname,upwd});
			
	}
	@Override
	public List<TelBook> findAllTelbook(int id) {
		String sql="select * from telbook where uid=?";
		
		//TODO
		return userDaoImpl.findAllTelbook(sql,id );
			
	}
	@Override
	public List<Contact> findContacts(int tid, int uid) {
		String sql="select * from contact where tid=? and uid=?";
		//TODO
		return userDaoImpl.findContacts(sql,new Object[]{tid,uid});
			
	}
	@Override
	public boolean deleteConcat(int cid) {
		String sql="delete from contact where cid =?";
		//TODO
		return userDaoImpl.deleteContact(sql,cid);
			
	}




}

	